import java.util.LinkedList;
import java.util.Scanner;
 static class ListNode {
    ListNode next;
    int val;
    public ListNode(int val){
        this.val = val;
    }
}
class MyListNode{

    ListNode head;
    public void add(int val){
        if(this.head==null){
            this.head = new ListNode(val);
            return ;
        }
        ListNode cur = this.head;
        while(cur.next ==null){
            cur = cur.next;
        }
        cur.next = new ListNode(val);
    }
}
public class TextDemo {
    public static void Print(ListNode head1,ListNode head2){


    }
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        MyListNode myListNode1 = new MyListNode();
        for(int i = 0;i<n;i++){
            myListNode1.add(scanner.nextInt());
        }
        int m = scanner.nextInt();
        MyListNode myListNode2 = new MyListNode();

        for(int i = 0;i<m;i++){
            myListNode2.add(scanner.nextInt());
        }
        Print(myListNode1.head,myListNode2.head);
    }
}
